home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-04-16 | 57.2 KB | 2,157 lines |
- *** ./bin/dig/Makefile Wed Jun 18 20:22:07 1997
- --- ../src/./bin/dig/Makefile Tue Feb 9 12:32:42 1999
- ***************
- *** 40,46 ****
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
-
- NSLOOKUP_OBJS= \
- ../nslookup/subr.${O} ../nslookup/send.${O} \
- --- 40,46 ----
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${CPPFLAGS}
-
- NSLOOKUP_OBJS= \
- ../nslookup/subr.${O} ../nslookup/send.${O} \
- ***************
- *** 63,69 ****
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- --- 63,69 ----
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- *** ./bin/addr/Makefile Wed Jun 18 20:22:06 1997
- --- ../src/./bin/addr/Makefile Tue Feb 9 12:32:31 1999
- ***************
- *** 40,46 ****
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
-
- PROG= addr
- SRCS= ${PROG}.c
- --- 40,46 ----
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${CPPFLAGS}
-
- PROG= addr
- SRCS= ${PROG}.c
- ***************
- *** 59,65 ****
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- --- 59,65 ----
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- *** ./bin/nsupdate/Makefile Wed Jun 18 20:22:11 1997
- --- ../src/./bin/nsupdate/Makefile Tue Feb 9 12:32:21 1999
- ***************
- *** 40,46 ****
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
-
- PROG= nsupdate
- SRCS= ${PROG}.c
- --- 40,46 ----
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${CPPFLAGS}
-
- PROG= nsupdate
- SRCS= ${PROG}.c
- ***************
- *** 59,65 ****
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- --- 59,65 ----
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- *** ./bin/host/Makefile Wed Jun 18 20:22:08 1997
- --- ../src/./bin/host/Makefile Tue Feb 9 12:28:22 1999
- ***************
- *** 40,46 ****
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
-
- PROG= host
- SRCS= ${PROG}.c
- --- 40,46 ----
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${CPPFLAGS}
-
- PROG= host
- SRCS= ${PROG}.c
- ***************
- *** 59,65 ****
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- --- 59,65 ----
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- *** ./bin/dnsquery/Makefile Wed Jun 18 20:22:08 1997
- --- ../src/./bin/dnsquery/Makefile Tue Feb 9 12:27:46 1999
- ***************
- *** 40,46 ****
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
-
- PROG= dnsquery
- SRCS= ${PROG}.c
- --- 40,46 ----
- STRIP=-s
-
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${CPPFLAGS}
-
- PROG= dnsquery
- SRCS= ${PROG}.c
- ***************
- *** 59,65 ****
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- --- 59,65 ----
- rm -f *.BAK *.CKP *~ *.orig
-
- depend: ${SRCS}
- ! mkdep -p -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${SRCS}
-
- ${DESTDIR}${DESTBIN}:
- mkdir -p ${DESTDIR}${DESTBIN}
- *** ./bin/named-xfer/Makefile Mon Apr 13 17:39:03 1998
- --- ../src/./bin/named-xfer/Makefile Tue Feb 9 12:27:11 1999
- ***************
- *** 43,49 ****
-
- PS=ps
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
-
- NAMED_OBJS= \
- ../named/db_glue.${O} ../named/ns_glue.${O} ../named/tmp_version.${O}
- --- 43,49 ----
-
- PS=ps
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${CPPFLAGS}
-
- NAMED_OBJS= \
- ../named/db_glue.${O} ../named/ns_glue.${O} ../named/tmp_version.${O}
- ***************
- *** 65,71 ****
- rm -f *.BAK *.CKP *~ *.${O} *.orig
-
- depend: ${SRCS}
- ! mkdep -p ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
-
- ${DESTDIR}${DESTEXEC}:
- mkdir -p ${DESTDIR}${DESTEXEC}
- --- 65,71 ----
- rm -f *.BAK *.CKP *~ *.${O} *.orig
-
- depend: ${SRCS}
- ! mkdep -p -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${SRCS}
-
- ${DESTDIR}${DESTEXEC}:
- mkdir -p ${DESTDIR}${DESTEXEC}
- *** ./bin/named-xfer/named-xfer.c Thu Mar 26 16:19:28 1998
- --- ../src/./bin/named-xfer/named-xfer.c Tue Feb 9 11:39:31 1999
- ***************
- *** 143,148 ****
- --- 143,158 ----
- #include <isc/eventlib.h>
- #include <isc/logging.h>
-
- + #ifdef _TRUSTED_IRIX
- + #include <cap_net.h> /* cap_bind() */
- + #include <sys/mac.h> /* tsix_set_mac_byrhost(), mac_t,
- + * tsix_set_solabel()
- + */
- + #include <sys/t6net.h> /* tsix_set_mac_byrhost(), mac_t,
- + * tsix_set_solabel()
- + */
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- #include "port_after.h"
-
- #define MAIN_PROGRAM
- ***************
- *** 673,681 ****
- --- 683,700 ----
- sin.sin_addr = zp->z_axfr_src;
- dprintf(2, "binding to address [%s]\n",
- inet_ntoa(sin.sin_addr));
- + #ifdef _TRUSTED_IRIX
- + if (cap_bind(s, (struct sockaddr *)&sin, sizeof sin)\
- + < 0)
- + syslog(LOG_INFO,\
- + "warning: cap_bind(%s) failed",
- + inet_ntoa(zp->z_axfr_src));
- + #else /* #ifdef _TRUSTED_IRIX */
- if (bind(s, (struct sockaddr *)&sin, sizeof sin) < 0)
- syslog(LOG_INFO, "warning: bind(%s) failed",
- inet_ntoa(zp->z_axfr_src));
- + #endif /* #ifdef _TRUSTED_IRIX #else */
- +
- }
- memset(&sin, 0, sizeof sin);
- sin.sin_family = AF_INET;
- ***************
- *** 683,689 ****
- --- 702,719 ----
- sin.sin_addr = zp->z_addr[cnt];
- dprintf(2, "connecting to server #%d [%s].%d\n",
- cnt+1, inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
- + #ifdef _TRUSTED_IRIX
- + /*
- + * Set MAC label of all outgoing comm and the socket to default
- + * remote MAC label.
- + */
- + if ( ((app_tsix_set_connect_mac(s,&sin) < 0)\
- + ||\
- + (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0)) )
- + {
- + #else /* #ifdef _TRUSTED_IRIX */
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- + #endif /* #ifdef _TRUSTED_IRIX */
- if (!quiet)
- syslog(LOG_INFO,
- "connect(%s) for zone %s failed: %m",
- *** ./bin/named/ns_req.c Thu Mar 26 16:21:03 1998
- --- ../src/./bin/named/ns_req.c Tue Feb 9 11:39:31 1999
- ***************
- *** 143,153 ****
- --- 143,162 ----
- u_int16_t, u_int16_t);
- static void copyCharString(u_char **, const char *);
-
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- static enum req_action req_query(HEADER *hp, u_char **cpp, u_char *eom,
- struct qstream *qsp,
- int *buflenp, int *msglenp,
- u_char *msg, int dfd,
- + struct sockaddr_in from,
- + req_info * request_info);
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- + static enum req_action req_query(HEADER *hp, u_char **cpp, u_char *eom,
- + struct qstream *qsp,
- + int *buflenp, int *msglenp,
- + u_char *msg, int dfd,
- struct sockaddr_in from);
- + #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
-
- static enum req_action req_iquery(HEADER *hp, u_char **cpp, u_char *eom,
- int *buflenp, u_char *msg,
- ***************
- *** 161,169 ****
- --- 170,184 ----
- /*
- * Process request using database; assemble and send response.
- */
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- void
- ns_req(u_char *msg, int msglen, int buflen, struct qstream *qsp,
- + struct sockaddr_in from, int dfd, req_info * request_info)
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- + void
- + ns_req(u_char *msg, int msglen, int buflen, struct qstream *qsp,
- struct sockaddr_in from, int dfd)
- + #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- {
- HEADER *hp = (HEADER *) msg;
- u_char *cp, *eom;
- ***************
- *** 195,203 ****
- --- 210,225 ----
-
- switch (hp->opcode) {
- case ns_o_query:
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + action = req_query(hp, &cp, eom, qsp,
- + &buflen, &msglen,
- + msg, dfd, from,
- + request_info);
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- action = req_query(hp, &cp, eom, qsp,
- &buflen, &msglen,
- msg, dfd, from);
- + #endif/* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- break;
-
- case ns_o_iquery:
- ***************
- *** 265,273 ****
- --- 287,309 ----
- fp_nquery(msg, cp - msg, log_get_stream(packet_channel));
- #endif /*DEBUG*/
- if (qsp == NULL) {
- + #ifdef _USE_ONE_SOCKET_PER_PROTO
- + #ifdef _TRUSTED_IRIX
- + if (sendfromto(dfd, (char*)msg, cp - msg, 0,\
- + &(request_info->to_addr),\
- + (struct sockaddr *)&from,\
- + sizeof(*from), request_info->from_label) < 0) {
- + #else /* #ifdef _TRUSTED_IRIX */
- + if (sendfromto(dfd, (char*)msg, cp - msg, 0,\
- + &(request_info->to_addr),\
- + (struct sockaddr *)&from,\
- + sizeof(*from)) < 0) {
- + #endif /* #ifdef _TRUSTED_IRIX */
- + #else /* #ifdef _USE_ONE_SOCKET_PER_PROTO */
- if (sendto(dfd, (char*)msg, cp - msg, 0,
- (struct sockaddr *)&from,
- sizeof(from)) < 0) {
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTO */
- if (!haveComplained(ina_ulong(from.sin_addr),
- (u_long)sendtoStr))
- ns_info(ns_log_default,
- ***************
- *** 409,418 ****
- --- 445,461 ----
- }
- #endif /*BIND_NOTIFY*/
-
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- static enum req_action
- req_query(HEADER *hp, u_char **cpp, u_char *eom, struct qstream *qsp,
- int *buflenp, int *msglenp, u_char *msg, int dfd,
- + struct sockaddr_in from, req_info * request_info)
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- + static enum req_action
- + req_query(HEADER *hp, u_char **cpp, u_char *eom, struct qstream *qsp,
- + int *buflenp, int *msglenp, u_char *msg, int dfd,
- struct sockaddr_in from)
- + #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- {
- int n, class, type, count, zone, foundname, founddata, omsglen, cname;
- u_int16_t id;
- ***************
- *** 905,912 ****
- --- 948,962 ----
- }
- *msglenp = n;
- }
- +
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- n = ns_forw(nsp, msg, *msglenp, from, qsp, dfd, &qp,
- + dname, class, type, np, 0, request_info);
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- + n = ns_forw(nsp, msg, *msglenp, from, qsp, dfd, &qp,
- dname, class, type, np, 0);
- + #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- +
- if (n != FW_OK && cname)
- memput(omsg, omsglen);
- switch (n) {
- ***************
- *** 1587,1592 ****
- --- 1637,1646 ----
- /* ask a real server for this info */
- (void) sysquery(ap->a_dname, (int)ap->a_class, T_A,
- NULL, 0, QUERY);
- + #ifdef IPv6_ENHANCEMENT
- + (void) sysquery(ap->a_dname, (int)ap->a_class, T_AAAA,
- + NULL, 0, QUERY);
- + #endif /* #ifdef IPv6_ENHANCEMENT */
- }
- if (foundcname) {
- if (!haveComplained(nhash(ap->a_dname),
- *** ./bin/named/ns_resp.c Mon Mar 16 11:40:07 1998
- --- ../src/./bin/named/ns_resp.c Tue Feb 9 11:39:31 1999
- ***************
- *** 122,127 ****
- --- 122,132 ----
- #include <isc/logging.h>
- #include <isc/memcluster.h>
-
- + #ifdef _TRUSTED_IRIX
- + #include <sys/mac.h> /* tsix_set_mac_byrhost() */
- + #include <sys/t6net.h> /* tsix_set_mac_byrhost() */
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- #include "port_after.h"
-
- #include "named.h"
- ***************
- *** 1380,1386 ****
- "ns_forw: tcp_send(%s) failed: %s",
- sin_ntoa(*nsa), strerror(errno));
- }
- ! } else if (sendto(ds, (char*)qp->q_msg, qp->q_msglen, 0,
- (struct sockaddr *)nsa,
- sizeof(struct sockaddr_in)) < 0)
- {
- --- 1385,1395 ----
- "ns_forw: tcp_send(%s) failed: %s",
- sin_ntoa(*nsa), strerror(errno));
- }
- ! } else if (
- ! #ifdef _TRUSTED_IRIX
- ! tsix_set_mac_byrhost (ds, &nsa->sin_addr, NULL) ||
- ! #endif /* #ifdef _TRUSTED_IRIX */
- ! sendto(ds, (char*)qp->q_msg, qp->q_msglen, 0,
- (struct sockaddr *)nsa,
- sizeof(struct sockaddr_in)) < 0)
- {
- ***************
- *** 1925,1933 ****
- --- 1934,1956 ----
- fp_nquery(msg, msglen, log_get_stream(packet_channel));
- #endif /* DEBUG */
- if (qp->q_stream == NULL) {
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + #ifdef _TRUSTED_IRIX
- + if (sendfromto(qp->q_dfd, (char*)msg, msglen, 0,
- + &qp->q_to, (struct sockaddr *)&qp->q_from,
- + sizeof(qp->q_from), qp->q_label) < 0) {
- + #else /* #ifdef _TRUSTED_IRIX */
- + if (sendfromto(qp->q_dfd, (char*)msg, msglen, 0,
- + &qp->q_to, (struct sockaddr *)&qp->q_from,
- + sizeof(qp->q_from)) < 0) {
- + #endif /* #ifdef _TRUSTED_IRIX #else */
- + #else /* #ifdef _USE_ONE_SOCKET_PER_PROTOCOL */
- if (sendto(qp->q_dfd, (char*)msg, msglen, 0,
- (struct sockaddr *)&qp->q_from,
- sizeof(qp->q_from)) < 0) {
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTOCOL #else */
- +
- if (!haveComplained(ina_ulong(qp->q_from.sin_addr),
- (u_long)sendtoStr))
- #if defined(SPURIOUS_ECONNREFUSED)
- ***************
- *** 2324,2330 ****
- fp_nquery(qp->q_msg, qp->q_msglen,
- log_get_stream(packet_channel));
- #endif
- ! if (sendto(qp->q_dfd, (char*)qp->q_msg, qp->q_msglen, 0,
- (struct sockaddr *)nsa,
- sizeof(struct sockaddr_in)) < 0) {
- if (!haveComplained(ina_ulong(nsa->sin_addr),
- --- 2347,2357 ----
- fp_nquery(qp->q_msg, qp->q_msglen,
- log_get_stream(packet_channel));
- #endif
- ! if (
- ! #ifdef _TRUSTED_IRIX
- ! tsix_set_mac_byrhost (qp->q_dfd, &nsa->sin_addr, NULL) ||
- ! #endif /* #ifdef _TRUSTED_IRIX */
- ! sendto(qp->q_dfd, (char*)qp->q_msg, qp->q_msglen, 0,
- (struct sockaddr *)nsa,
- sizeof(struct sockaddr_in)) < 0) {
- if (!haveComplained(ina_ulong(nsa->sin_addr),
- *** ./bin/named/ns_defs.h Mon Apr 13 17:35:09 1998
- --- ../src/./bin/named/ns_defs.h Tue Feb 9 11:39:31 1999
- ***************
- *** 72,77 ****
- --- 72,81 ----
- * SOFTWARE.
- */
-
- + #ifdef _TRUSTED_IRIX
- + #include <sys/mac.h>
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- /*
- * Global definitions for the name server.
- */
- ***************
- *** 202,207 ****
- --- 206,232 ----
- } \
- } while (0)
-
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + /* Structure used to pass requestor's target address and its MAC
- + * label.
- + */
- +
- + typedef struct _req_info {
- +
- + #ifdef _TRUSTED_IRIX
- + mac_t from_label; /* MAC label of requestor node */
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + struct in_addr to_addr; /* Target or destination address
- + * used by requestor.
- + */
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + } req_info;
- +
- + #endif /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL)*/
- +
- enum severity { ignore, warn, fail, not_set };
-
- enum znotify { znotify_use_default=0, znotify_yes, znotify_no };
- ***************
- *** 350,355 ****
- --- 375,389 ----
- u_int16_t q_nsid; /* id of forwarded query */
- struct sockaddr_in
- q_from; /* requestor's address */
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + struct in_addr q_to; /* their idea of our address */
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + #ifdef _TRUSTED_IRIX
- + mac_t q_label; /* requestor's mac label */
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- u_char *q_msg, /* the message */
- *q_cmsg; /* the cname message */
- int16_t q_msglen, /* len of message */
- *** ./bin/named/ns_func.h Thu Mar 19 16:53:44 1998
- --- ../src/./bin/named/ns_func.h Tue Feb 9 11:39:31 1999
- ***************
- *** 136,142 ****
- --- 136,146 ----
- extern void ns_req(u_char *, int, int,
- struct qstream *,
- struct sockaddr_in,
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + int, req_info *),
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- int),
- + #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- free_addinfo(void),
- free_nsp(struct databuf **);
- extern int stale(struct databuf *),
- ***************
- *** 174,180 ****
- --- 178,188 ----
- int class,
- int type,
- struct namebuf *np,
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + int use_tcp, req_info * request_info),
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- int use_tcp),
- + #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- haveComplained(u_long, u_long),
- nslookup(struct databuf *nsp[],
- struct qinfo *qp,
- *** ./bin/named/Makefile Thu Mar 19 16:49:46 1998
- --- ../src/./bin/named/Makefile Tue Feb 9 12:26:08 1999
- ***************
- *** 44,50 ****
-
- PS=ps
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${DEFS}
-
- VER= LOCAL-`date +%y%m%d.%H%M%S`
- HOSTNAMECMD= hostname || uname -n
- --- 44,50 ----
-
- PS=ps
- LDFLAGS=
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${DEFS} ${CPPFLAGS}
-
- VER= LOCAL-`date +%y%m%d.%H%M%S`
- HOSTNAMECMD= hostname || uname -n
- ***************
- *** 106,112 ****
- rm -f y.tab.h y.tab.c
-
- depend: ${SRCS} pathnames.h
- ! mkdep ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${DEFS} ${SRCS}
-
- ${DESTDIR}${DESTSBIN}:
- mkdir -p ${DESTDIR}${DESTSBIN}
- --- 106,112 ----
- rm -f y.tab.h y.tab.c
-
- depend: ${SRCS} pathnames.h
- ! mkdep -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${DEFS} ${SRCS}
-
- ${DESTDIR}${DESTSBIN}:
- mkdir -p ${DESTDIR}${DESTSBIN}
- *** ./bin/named/ns_main.c Tue Apr 28 12:17:46 1998
- --- ../src/./bin/named/ns_main.c Tue Feb 9 11:39:31 1999
- ***************
- *** 126,131 ****
- --- 126,135 ----
- #include <isc/memcluster.h>
- #include <isc/list.h>
-
- + #ifdef _TRUSTED_IRIX
- + #include <cap_net.h> /* cap_bind() */
- + #endif
- +
- #include "port_after.h"
-
- #ifdef HAVE_GETRUSAGE /* XXX */
- ***************
- *** 171,177 ****
- --- 175,186 ----
- dispatch_message(u_char *, int, int,
- struct qstream *,
- struct sockaddr_in, int,
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + interface *,
- + req_info *);
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- interface *);
- + #endif /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else*/
- static void stream_send(evContext, void *, int,
- const void *, int,
- const void *, int);
- ***************
- *** 873,880 ****
- --- 882,894 ----
-
- nameserIncr(sp->s_from.sin_addr, nssRcvdTCP);
- sq_query(sp);
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- dispatch_message(sp->s_buf, bytes, sp->s_bufsize, sp, sp->s_from, -1,
- + sp->s_ifp, NULL);
- + #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- + dispatch_message(sp->s_buf, bytes, sp->s_bufsize, sp, sp->s_from, -1,
- sp->s_ifp);
- + #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- }
-
- static void
- ***************
- *** 887,896 ****
- --- 901,929 ----
- HEADER h; /* Force alignment of 'buf'. */
- u_char buf[PACKETSZ+1];
- } u;
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + req_info request_info; /* Used to pass information
- + * about incoming requests.
- + */
- +
- +
- + n = recvfromto(fd, (char *)u.buf, sizeof u.buf, 0,
- + (struct sockaddr *)&from, from_len
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + , &(request_info.to_addr)
- + #ifdef _TRUSTED_IRIX
- + , &(request_info.from_label)
- + #endif /* #ifdef _TRUSTED_IRIX */
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTOCOL */
- + );
- +
- + #else /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
-
- n = recvfrom(fd, (char *)u.buf, sizeof u.buf, 0,
- (struct sockaddr *)&from, &from_len);
-
- + #endif /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else*/
- +
- if (n < 0) {
- switch (errno) {
- case EINTR:
- ***************
- *** 950,961 ****
- --- 983,1008 ----
- }
-
- gettime(&tt); /* Keep 'tt' current. */
- +
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + dispatch_message(u.buf, n, PACKETSZ, NULL, from, fd, ifp,\
- + &request_info);
- + #else
- dispatch_message(u.buf, n, PACKETSZ, NULL, from, fd, ifp);
- + #endif /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL)*/
- +
- }
-
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- static void
- dispatch_message(u_char *msg, int msglen, int buflen, struct qstream *qsp,
- + struct sockaddr_in from, int dfd, interface *ifp,
- + req_info * request_info)
- + #else
- + static void
- + dispatch_message(u_char *msg, int msglen, int buflen, struct qstream *qsp,
- struct sockaddr_in from, int dfd, interface *ifp)
- + #endif
- {
- HEADER *hp = (HEADER *)msg;
-
- ***************
- *** 971,977 ****
- --- 1018,1028 ----
- if (needs_prime_cache)
- prime_cache();
- } else if (ifp != NULL)
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- + ns_req(msg, msglen, buflen, qsp, from, dfd, request_info);
- + #else /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL)*/
- ns_req(msg, msglen, buflen, qsp, from, dfd);
- + #endif /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else*/
- else {
- ns_notice(ns_log_security,
- "refused query on non-query socket from %s",
- ***************
- *** 996,1001 ****
- --- 1047,1055 ----
- ip_match_element ime;
- u_char *mask_ptr;
- struct in_addr mask;
- + #ifdef _USE_ONE_SOCKET_PER_PROTO
- + int first_iter = 1;
- + #endif
-
- ns_debug(ns_log_default, 1, "getnetconf(generation %lu)",
- (u_long)my_generation);
- ***************
- *** 1024,1030 ****
- --- 1078,1092 ----
-
- ifc.ifc_len = sizeof buf;
- ifc.ifc_buf = buf;
- + #ifdef IRIX_EMUL_IOCTL_SIOCGIFCONF
- + /* This is a fix for IRIX OS in which the call to ioctl with the flag
- + * SIOCGIFCONF may not return an entry for all the interfaces like
- + * most falvors of Unix.
- + */
- + if (emul_ioctl(&ifc) < 0)
- + #else
- if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0)
- + #endif
- ns_panic(ns_log_default, 1, "get interface configuration: %s",
- strerror(errno));
-
- ***************
- *** 1069,1074 ****
- --- 1131,1149 ----
- }
- ina = ina_get((u_char *)&((struct sockaddr_in *)
- &ifreq.ifr_addr)->sin_addr);
- + #ifdef _USE_ONE_SOCKET_PER_PROTO
- + if ( first_iter && !periodic_scan ) {
- +
- + /* Do not open generic sockets if this is a periodic
- + * scan they are already open.
- + */
- +
- + ina.sin_family = AF_INET;
- + ina.sin_addr.s_addr = INADDR_ANY;
- +
- +
- + }
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTO */
- ns_debug(ns_log_default, 1,
- "getnetconf: considering %s [%s]",
- ifreq.ifr_name, inet_ntoa(ina));
- ***************
- *** 1076,1086 ****
- --- 1151,1165 ----
- * Don't test IFF_UP, packets may still be received at this
- * address if any other interface is up.
- */
- +
- + #ifndef _USE_ONE_SOCKET_PER_PROTO
- +
- if (ina_hlong(ina) == INADDR_ANY) {
- ns_debug(ns_log_default, 2,
- "getnetconf: INADDR_ANY, ignoring.");
- continue;
- }
- + #endif
-
- INSIST(server_options != NULL);
- INSIST(server_options->listen_list != NULL);
- ***************
- *** 1122,1127 ****
- --- 1201,1224 ----
- ifp->flags = 0;
- ifp->dfd = -1;
- ifp->sfd = -1;
- + #ifdef _USE_ONE_SOCKET_PER_PROTO
- + if ( first_iter ) {
- +
- + /* Open only INADDR_ANY or generic sockets
- + */
- +
- + if (opensocket_d(ifp) < 0 ||
- + opensocket_s(ifp) < 0) {
- + dq_remove(ifp);
- + found = 0;
- + break;
- + }
- +
- + cp -= cpsize;
- + first_iter = 0;
- +
- + }/* if ( first_iter ) */
- + #else /* #ifdef _USE_ONE_SOCKET_PER_PROTO */
- if (opensocket_d(ifp) < 0 ||
- opensocket_s(ifp) < 0) {
- dq_remove(ifp);
- ***************
- *** 1128,1133 ****
- --- 1225,1232 ----
- found = 0;
- break;
- }
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTO #else */
- +
- ns_info(ns_log_default,
- "listening on [%s].%u (%s)",
- inet_ntoa(ina), ntohs(li->port),
- ***************
- *** 1270,1275 ****
- --- 1369,1382 ----
- strerror(errno));
- return (-1);
- }
- +
- + #ifdef _TRUSTED_IRIX
- + if (tsix_on(ifp->dfd) == -1) {
- + ns_error(ns_log_default, "tsix_on(s=%d): %s", ifp->dfd,
- + strerror(errno));
- + }
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- #ifdef F_DUPFD /* XXX */
- /*
- * Leave a space for stdio to work in.
- ***************
- *** 1307,1317 ****
- --- 1414,1461 ----
- /* XXX press on regardless, this is not too serious. */
- }
- #endif
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTO
- + /*
- + * The IP_RECVDSTADDR option allows us to receive the IP destination
- + * address with the request so that we can turn around and send the
- + * packet as if it came from that address. This is a workaround
- + * for connected UDP and IP aliases.
- + */
- +
- + if (setsockopt(ifp->dfd, IPPROTO_IP, IP_RECVDSTADDR,\
- + (char *)&on, sizeof(on)) != 0) {
- +
- + /* Can't operate in this mode if this fails! */
- +
- + ns_error(ns_log_default, "setsockopt(dfd=%d): %s", ifp->dfd,\
- + strerror(errno));
- + return (-1);
- +
- + }
- +
- + #endif /* #ifdef _USE_ONE_SOCKET_PER_PROTO */
- + #ifdef _TRUSTED_IRIX
- +
- + if (cap_bind(ifp->dfd, (struct sockaddr *)&nsa, sizeof nsa)) {
- +
- + ns_error(ns_log_default, "cap_bind(dfd=%d, %s): %s",
- + ifp->dfd, sin_ntoa(nsa), strerror(errno));
- + return (-1);
- +
- + }
- +
- + #else /* #ifdef _TRUSTED_IRIX */
- +
- if (bind(ifp->dfd, (struct sockaddr *)&nsa, sizeof nsa)) {
- +
- ns_error(ns_log_default, "bind(dfd=%d, %s): %s",
- ifp->dfd, sin_ntoa(nsa), strerror(errno));
- return (-1);
- +
- }
- + #endif /* #ifdef _TRUSTED_IRIX #else */
- +
- if (evSelectFD(ev, ifp->dfd, EV_READ, datagram_read, ifp,
- &ifp->evID_d) == -1) {
- ns_error(ns_log_default, "evSelectFD(dfd=%d): %s",
- ***************
- *** 1367,1373 ****
- --- 1511,1522 ----
- strerror(errno));
- /* Consider that your first warning of trouble to come. */
- }
- +
- + #ifdef _TRUSTED_IRIX
- + if (cap_bind(ifp->sfd, (struct sockaddr *)&nsa, sizeof nsa) < 0) {
- + #else /* #ifdef _TRUSTED_IRIX */
- if (bind(ifp->sfd, (struct sockaddr *)&nsa, sizeof nsa) < 0) {
- + #endif /* #ifdef _TRUSTED_IRIX #else */
- if (errno != EADDRINUSE || ++n > 4) {
- if (errno == EADDRINUSE)
- ns_error(ns_log_default,
- ***************
- *** 1374,1382 ****
- --- 1523,1537 ----
- "There may be a name server already running on %s",
- sin_ntoa(nsa));
- else
- + #ifdef _TRUSTED_IRIX
- + ns_error(ns_log_default,
- + "cap_bind(sfd=%d, %s): %s", ifp->sfd,
- + sin_ntoa(nsa), strerror(errno));
- + #else
- ns_error(ns_log_default,
- "bind(sfd=%d, %s): %s", ifp->sfd,
- sin_ntoa(nsa), strerror(errno));
- + #endif
- return (-1);
- }
-
- ***************
- *** 1466,1476 ****
- --- 1621,1640 ----
- strerror(errno));
- /* XXX press on regardless, this is not too serious. */
- }
- +
- + #ifdef _TRUSTED_IRIX
- + if (cap_bind(ds, (struct sockaddr *)&server_options->query_source,
- + sizeof server_options->query_source) < 0)
- + ns_panic(ns_log_default, 1, "opensocket_f: cap_bind(%s): %s",
- + sin_ntoa(server_options->query_source),
- + strerror(errno));
- + #else /* #ifdef _TRUSTED_IRIX */
- if (bind(ds, (struct sockaddr *)&server_options->query_source,
- sizeof server_options->query_source) < 0)
- ns_panic(ns_log_default, 1, "opensocket_f: bind(%s): %s",
- sin_ntoa(server_options->query_source),
- strerror(errno));
- + #endif /* #ifdef _TRUSTED_IRIX #else */
-
- n = sizeof nsa;
- if (getsockname(ds, (struct sockaddr *)&nsa, &n) < 0)
- *** ./bin/named/ns_forw.c Mon Feb 23 17:02:40 1998
- --- ../src/./bin/named/ns_forw.c Tue Feb 9 11:39:31 1999
- ***************
- *** 97,102 ****
- --- 97,108 ----
-
- #include "port_after.h"
-
- + #ifdef _TRUSTED_IRIX
- + #include <sys/mac.h> /* tsix_set_mac_byrhost() */
- + #include <sys/t6net.h> /* tsix_set_mac_byrhost() */
- + #include <sys/mac_label.h> /* mac_dup() */
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- #include "named.h"
-
- struct complaint {
- ***************
- *** 122,128 ****
- ns_forw(struct databuf *nsp[], u_char *msg, int msglen,
- struct sockaddr_in from, struct qstream *qsp, int dfd,
- struct qinfo **qpp, const char *dname, int class, int type,
- ! struct namebuf *np, int use_tcp)
- {
- struct qinfo *qp;
- char tmpdomain[MAXDNAME];
- --- 128,139 ----
- ns_forw(struct databuf *nsp[], u_char *msg, int msglen,
- struct sockaddr_in from, struct qstream *qsp, int dfd,
- struct qinfo **qpp, const char *dname, int class, int type,
- ! #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- ! struct namebuf *np, int use_tcp, req_info * request_info)
- ! #else /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- ! struct namebuf *np, int use_tcp )
- ! #endif /* #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) #else */
- !
- {
- struct qinfo *qp;
- char tmpdomain[MAXDNAME];
- ***************
- *** 155,160 ****
- --- 166,183 ----
- getname(np, tmpdomain, sizeof tmpdomain);
- qp->q_domain = savestr(tmpdomain, 1);
- qp->q_from = from; /* nslookup wants to know this */
- +
- + #ifdef _TRUSTED_IRIX
- + /* DO WE HAVE TO DUPLICATE THIS LABEL ??? */
- + if( request_info != NULL )
- + qp->q_label = (mac_t) mac_dup((mac_label *)request_info->from_label);
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + if( request_info != NULL )
- + qp->q_to = request_info->to_addr;
- + #endif
- +
- n = nslookup(nsp, qp, dname, "ns_forw");
- if (n < 0) {
- ns_debug(ns_log_default, 2, "forw: nslookup reports danger");
- ***************
- *** 220,231 ****
- "ns_forw: tcp_send(%s) failed: %s",
- sin_ntoa(*nsa), strerror(errno));
- }
- ! } else if (sendto(ds, (char *)msg, msglen, 0, (struct sockaddr *)nsa,
- ! sizeof(struct sockaddr_in)) < 0) {
- if (!haveComplained(ina_ulong(nsa->sin_addr),
- (u_long)sendtoStr))
- ! ns_info(ns_log_default, "ns_forw: sendto(%s): %s",
- sin_ntoa(*nsa), strerror(errno));
- nameserIncr(nsa->sin_addr, nssSendtoErr);
- }
- if (NS_OPTION_P(OPTION_HOSTSTATS))
- --- 243,265 ----
- "ns_forw: tcp_send(%s) failed: %s",
- sin_ntoa(*nsa), strerror(errno));
- }
- ! } else if (
- ! #ifdef _TRUSTED_IRIX
- ! tsix_set_mac_byrhost (ds, &(nsa->sin_addr), NULL) ||
- ! #endif /* #ifdef _TRUSTED_IRIX */
- ! (sendto(ds, (char *)msg, msglen, 0, (struct sockaddr *)nsa,
- ! sizeof(struct sockaddr_in)) < 0)) {
- if (!haveComplained(ina_ulong(nsa->sin_addr),
- (u_long)sendtoStr))
- ! #ifdef _TRUSTED_IRIX
- ! ns_info(ns_log_default,\
- ! "ns_forw: tsix_set_mac_byrhost|sendto(%s): %s",
- ! sin_ntoa(*nsa), strerror(errno));
- ! #else /* #ifdef _TRUSTED_IRIX */
- ! ns_info(ns_log_default,\
- ! "ns_forw: sendto(%s): %s",
- sin_ntoa(*nsa), strerror(errno));
- + #endif /* #ifdef _TRUSTED_IRIX #else */
- nameserIncr(nsa->sin_addr, nssSendtoErr);
- }
- if (NS_OPTION_P(OPTION_HOSTSTATS))
- ***************
- *** 967,975 ****
- ns_debug(ns_log_default, 3,
- "error resending tcp msg: %s",
- strerror(errno));
- ! } else if (sendto(ds, (char*)qp->q_msg, qp->q_msglen, 0,
- (struct sockaddr *)nsa,
- ! sizeof(struct sockaddr_in)) < 0)
- {
- ns_debug(ns_log_default, 3, "error resending msg: %s",
- strerror(errno));
- --- 1001,1013 ----
- ns_debug(ns_log_default, 3,
- "error resending tcp msg: %s",
- strerror(errno));
- ! } else if (
- ! #ifdef _TRUSTED_IRIX
- ! tsix_set_mac_byrhost (ds, &(nsa->sin_addr), NULL) ||
- ! #endif /* #ifdef _TRUSTED_IRIX */
- ! (sendto(ds, (char*)qp->q_msg, qp->q_msglen, 0,
- (struct sockaddr *)nsa,
- ! sizeof(struct sockaddr_in)) < 0))
- {
- ns_debug(ns_log_default, 3, "error resending msg: %s",
- strerror(errno));
- *** ./bin/named/ns_update.c Tue May 5 12:45:10 1998
- --- ../src/./bin/named/ns_update.c Tue Feb 9 11:39:31 1999
- ***************
- *** 892,899 ****
- --- 892,905 ----
- * If the request came in over TCP, forward it over TCP
- */
- should_use_tcp = (qsp != NULL);
- +
- + #if !defined(_USE_ONE_SOCKET_PER_PROTOCOL) && !defined(_TRUSTED_IRIX)
- + /* This is broken so no problem if we take it out
- + * for the time being.
- + */
- n = ns_forw(nsp, msg, eom-msg, from, qsp, dfd, &qp,
- dname, class, type, NULL, should_use_tcp);
- + #endif /* #if !defined(_USE_ONE_SOCKET_PER_PROTOCOL) */
- free_nsp(nsp);
- switch (n) {
- case FW_OK:
- *** ./bin/nslookup/Makefile Wed Dec 3 14:55:16 1997
- --- ../src/./bin/nslookup/Makefile Tue Feb 9 12:23:38 1999
- ***************
- *** 41,47 ****
-
- LDFLAGS=
- DEFS= -D_PATH_HELPFILE=\"${DESTDIR}${DESTHELP}/nslookup.help\"
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${DEFS}
-
- PROG= nslookup
- CSRCS= main.c getinfo.c debug.c send.c skip.c list.c subr.c
- --- 41,47 ----
-
- LDFLAGS=
- DEFS= -D_PATH_HELPFILE=\"${DESTDIR}${DESTHELP}/nslookup.help\"
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${DEFS} ${CPPFLAGS}
-
- PROG= nslookup
- CSRCS= main.c getinfo.c debug.c send.c skip.c list.c subr.c
- ***************
- *** 64,70 ****
- rm -f lex.yy.c lex.yy.o
-
- depend: ${SRCS}
- ! mkdep ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${DEFS} ${CSRCS}
-
- ${DESTDIR}${DESTHELP}:
- mkdir -p ${DESTDIR}${DESTHELP}
- --- 64,70 ----
- rm -f lex.yy.c lex.yy.o
-
- depend: ${SRCS}
- ! mkdep -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${DEFS} ${CSRCS}
-
- ${DESTDIR}${DESTHELP}:
- mkdir -p ${DESTDIR}${DESTHELP}
- *** ./bin/nslookup/getinfo.c Thu Mar 19 11:30:55 1998
- --- ../src/./bin/nslookup/getinfo.c Tue Feb 23 10:20:47 1999
- ***************
- *** 199,205 ****
- * If there are no answer, n.s. or additional records
- * then return with an error.
- */
- ! if (ancount == 0 && nscount == 0 && arcount == 0) {
- return (NO_INFO);
- }
-
- --- 199,205 ----
- * If there are no answer, n.s. or additional records
- * then return with an error.
- */
- ! if (ancount == 0 /*&& nscount == 0 && arcount == 0 */) {
- return (NO_INFO);
- }
-
- *** ./lib/bsd/Makefile Wed May 21 12:32:07 1997
- --- ../src/./lib/bsd/Makefile Tue Feb 9 12:35:41 1999
- ***************
- *** 54,60 ****
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- --- 54,60 ----
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CFLAGS} ${CPPFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- *** ./lib/irs/Makefile Wed May 21 12:23:18 1997
- --- ../src/./lib/irs/Makefile Tue Feb 9 12:09:21 1999
- ***************
- *** 60,66 ****
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- --- 60,66 ----
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CFLAGS} ${CPPFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- *** ./lib/isc/Makefile Wed Dec 3 14:36:08 1997
- --- ../src/./lib/isc/Makefile Tue Feb 9 12:08:56 1999
- ***************
- *** 54,60 ****
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- --- 54,60 ----
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CFLAGS} ${CPPFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- *** ./lib/isc/ev_connects.c Fri Mar 20 15:26:22 1998
- --- ../src/./lib/isc/ev_connects.c Tue Feb 9 11:39:31 1999
- ***************
- *** 37,42 ****
- --- 37,51 ----
- #include <isc/assertions.h>
- #include "eventlib_p.h"
-
- + #ifdef _TRUSTED_IRIX
- + #include <sys/mac.h> /* tsix_set_mac_byrhost(), mac_t,
- + * tsix_set_solabel()
- + */
- + #include <sys/t6net.h> /* tsix_set_mac_byrhost(), mac_t,
- + * tsix_set_solabel()
- + */
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- #include "port_after.h"
-
- /* Forward. */
- ***************
- *** 109,118 ****
- return (-1);
- }
- new->flags |= EV_CONN_SELECTED;
- ! if (connect(fd, ra, ralen) < 0 &&
- ! errno != EWOULDBLOCK &&
- ! errno != EAGAIN &&
- ! errno != EINPROGRESS) {
- int save = errno;
-
- (void) evDeselectFD(opaqueCtx, new->file);
- --- 118,132 ----
- return (-1);
- }
- new->flags |= EV_CONN_SELECTED;
- ! if ( (
- ! #ifdef _TRUSTED_IRIX
- ! (app_tsix_set_connect_mac(fd,(struct sockaddr_in *)ra) < 0)
- ! ||
- ! #endif /* #ifdef _TRUSTED_IRIX */
- ! (connect(fd, ra, ralen) < 0)) &&
- ! (errno != EWOULDBLOCK)&&
- ! (errno != EAGAIN) &&
- ! (errno != EINPROGRESS)) {
- int save = errno;
-
- (void) evDeselectFD(opaqueCtx, new->file);
- ***************
- *** 232,237 ****
- --- 246,266 ----
- new->fd = -1;
- } else
- new->ioErrno = 0;
- +
- + #ifdef _TRUSTED_IRIX
- +
- + /* Set MAC to that of the connecting entity */
- +
- + if (app_tsix_set_accept_mac( new->fd ) < 0) {
- +
- + new->ioErrno = errno;
- + (void) close(new->fd);
- + new->fd = -1;
- +
- + }
- +
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- } else {
- new->ioErrno = errno;
- if (errno == EAGAIN || errno == EWOULDBLOCK) {
- ***************
- *** 265,270 ****
- --- 294,312 ----
- errno = save;
- new = -1;
- }
- + #ifdef _TRUSTED_IRIX
- + else if (app_tsix_set_accept_mac( new ) < 0) {
- +
- + int save = errno;
- +
- + (void) close(new);
- + errno = save;
- + new = -1;
- +
- + }
- +
- + #endif /* #ifdef _TRUSTED_IRIX */
- +
- } else if (errno == EAGAIN || errno == EWOULDBLOCK)
- return;
- (*conn->func)(opaqueCtx, conn->uap, new, &la, lalen, &ra, ralen);
- *** ./lib/inet/Makefile Wed May 21 12:32:07 1997
- --- ../src/./lib/inet/Makefile Tue Feb 9 12:08:31 1999
- ***************
- *** 53,59 ****
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- --- 53,59 ----
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CFLAGS} ${CPPFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- *** ./lib/resolv/Makefile Wed May 21 12:32:09 1997
- --- ../src/./lib/resolv/Makefile Tue Feb 9 12:06:15 1999
- ***************
- *** 52,58 ****
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- --- 52,58 ----
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CFLAGS} ${CPPFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- *** ./lib/resolv/res_update.c Tue Mar 10 14:04:48 1998
- --- ../src/./lib/resolv/res_update.c Tue Feb 23 16:01:18 1999
- ***************
- *** 446,452 ****
- } /* while */
- }
-
- ! _res.options |= RES_DEBUG;
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
-
- /* append zone section */
- --- 446,453 ----
- } /* while */
- }
-
- ! /* _res.options |= RES_DEBUG; */
- !
- for (zptr = zgrp_start; zptr; zptr = zptr->z_next) {
-
- /* append zone section */
- ***************
- *** 465,472 ****
- fprintf(stderr, "res_mkupdate error\n");
- fflush(stderr);
- return (-1);
- ! } else
- fprintf(stdout, "res_mkupdate: packet size = %d\n", n);
-
- /*
- * Override the list of NS records from res_init() with
- --- 466,474 ----
- fprintf(stderr, "res_mkupdate error\n");
- fflush(stderr);
- return (-1);
- ! }/* else
- fprintf(stdout, "res_mkupdate: packet size = %d\n", n);
- + */
-
- /*
- * Override the list of NS records from res_init() with
- *** ./lib/nameser/Makefile Wed May 21 12:32:08 1997
- --- ../src/./lib/nameser/Makefile Tue Feb 9 12:07:37 1999
- ***************
- *** 50,56 ****
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- --- 50,56 ----
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CFLAGS} ${CPPFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean: clean
- *** ./port/irix/include/port_after.h Mon Apr 6 16:46:22 1998
- --- ../src/./port/irix/include/port_after.h Tue Feb 9 11:39:30 1999
- ***************
- *** 42,44 ****
- --- 42,72 ----
- * in IRIX, this is sufficient.
- */
- #define vfork fork
- +
- + #ifdef IRIX_EMUL_IOCTL_SIOCGIFCONF
- +
- + /* This fucntion is used to emulate ioctl( SIOCGIFCONF ) in IRIX so that
- + * it will behave like in most UNIX systems returning an entry for each
- + * IP interface. This fixes the IP aliasing problem in IRIX.
- + * The sysctl system call is used to retrieve the interface info which is
- + * the transfered to the ifconf structure returned by ioctl().
- + *
- + * File: emul_ioctl.h
- + * By: gomez@cs.purdue.edu
- + * Date: 11/02/98
- + *
- + */
- +
- + #ifndef _EMUL_IOCTL_H_
- + #define _EMUL_IOCTL_H_
- +
- + #include <net/if.h>
- + /* struct ifconf, struct if_msghdr, struct ifa_msghdr,
- + * struct ifreq
- + */
- +
- + int emul_ioctl( struct ifconf * ifc );
- +
- + #endif
- +
- + #endif /* #ifdef IRIX_EMUL_IOCTL_SIOCGIFCONF */
- *** ./port/irix/include/port_before.h Fri Mar 20 16:59:55 1998
- --- ../src/./port/irix/include/port_before.h Tue Feb 9 13:49:38 1999
- ***************
- *** 3,7 ****
- --- 3,65 ----
- #undef WANT_IRS_PW
- #undef WANT_IRS_GR
- #define SIG_FN void
- + #define _USE_ONE_SOCKET_PER_PROTOCOL /* Do not use a socket per interface */
-
- + /* #define _TRUSTED_IRIX */ /* Compile trusted IRIX support */
- +
- + #ifndef _APP_TSIX_H_
- + #define _APP_TSIX_H_
- +
- + #ifdef _TRUSTED_IRIX
- +
- + #include <sys/types.h> /* mac.h */
- + #include <sys/mac.h> /* tsix_get_mac(), tsix_set_mac(), */
- + #include <netinet/in.h> /* struct sockaddr_in */
- +
- + int app_tsix_set_accept_mac( int fd );
- + int app_tsix_set_connect_mac( int fd, struct sockaddr_in * ra);
- +
- + #endif /* #ifdef _TRUSTED_IRIX */
- + #endif /* #ifndef _APP_TSIX_H_ */
- +
- + #define IPv6_ENHANCEMENT
- +
- +
- + #ifndef _IRIX_UTIL_H_
- + #define _IRIX_UTIL_H_
- +
- + #include <sys/types.h>
- + #include <sys/socket.h>
- + #include <netinet/in.h>
- +
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- +
- + int
- + sendfromto(int fd, void *buf, int buflen, int flags, struct in_addr *from
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + , void *to, int tolen
- + #endif /*#ifdef _USE_ONE_SOCKET_PER_PROTOCOL */
- + #ifdef _TRUSTED_IRIX
- + , mac_t lbl
- + #endif /* _TRUSTED_IRIX */
- + );
- +
- +
- + int
- + recvfromto(int fd, void *buf, int buflen, int flags, struct sockaddr *from,
- + int fromlen
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + , struct in_addr *to
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- + #ifdef _TRUSTED_IRIX
- + , mac_t *lbl
- + #endif /* _TRUSTED_IRIX */
- + );
- +
- + #endif /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL)*/
- +
- + #endif /* #ifndef _IRIX_UTIL_H_ */
- +
- #include <limits.h> /* _POSIX_PATH_MAX */
- +
- + #define IRIX_EMUL_IOCTL_SIOCGIFCONF /* ENBL COMPILATION OF IP ALIAS FIX */
- *** ./port/irix/Makefile Wed Jun 18 20:22:28 1997
- --- ../src/./port/irix/Makefile Tue Feb 9 12:33:39 1999
- ***************
- *** 31,37 ****
- INCL = ${TOP}/include
- PORTINCL = ${TOP}/port/${SYSTYPE}/include
- LIBBIND = ${TOP}/lib/libbind.${A}
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
- LD_LIBFLAGS= -x -r
- AR= ar cruv
- RANLIB= :
- --- 31,37 ----
- INCL = ${TOP}/include
- PORTINCL = ${TOP}/port/${SYSTYPE}/include
- LIBBIND = ${TOP}/lib/libbind.${A}
- ! CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL} ${CPPFLAGS}
- LD_LIBFLAGS= -x -r
- AR= ar cruv
- RANLIB= :
- ***************
- *** 57,63 ****
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean:: clean
- --- 57,63 ----
- ${RANLIB} ${LIBBIND}
-
- .c.${O}:
- ! ${CC} ${CFLAGS} -c $*.c
- -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
-
- distclean:: clean
- *** ./port/irix/Makefile.set Fri Mar 20 16:57:20 1998
- --- ../src/./port/irix/Makefile.set Tue Feb 9 12:56:52 1999
- ***************
- *** 1,5 ****
- ! 'CC=cc'
- ! 'CDEBUG=-g3 -O2'
- 'DESTBIN=/usr/bin'
- 'DESTSBIN=/usr/sbin'
- 'DESTEXEC=/usr/sbin'
- --- 1,6 ----
- ! 'CC=${TOOLROOT}/usr/bin/cc'
- ! 'CDEBUG=-g3 -O3 -OPT:Olimit=0:space=ON'
- ! 'CPPFLAGS=-nostdinc -I. -I${ROOT}/usr/include -D_BSD_SIGNALS'
- 'DESTBIN=/usr/bin'
- 'DESTSBIN=/usr/sbin'
- 'DESTEXEC=/usr/sbin'
- ***************
- *** 7,12 ****
- --- 8,14 ----
- 'DESTHELP=/usr/lib'
- 'DESTETC=/etc'
- 'DESTRUN=/etc'
- + 'LDFLAGS=-n32 -mips3 -nostdlib -L${ROOT}/usr/lib32 -rpath /usr/freeware/lib32'
- 'LDS=:'
- 'LEX=lex'
- 'YACC=yacc'
- *** ./port/irix/noop.c Thu Apr 24 14:48:06 1997
- --- ../src/./port/irix/noop.c Tue Feb 9 13:21:12 1999
- ***************
- *** 1,4 ****
- --- 1,556 ----
- + #include <port_before.h>
- + #include <port_after.h>
- +
- void
- __bind_noop() {
- /* NOOP */
- }
- +
- +
- + #include <sys/types.h>
- + #include <sys/socket.h>
- + #include <netinet/in.h>
- + #include <sys/uio.h>
- + #include <stdio.h>
- +
- + #ifndef CMSG_FIRSTHDR /* Include file patch for IRIX 6.2 */
- + #define IP_SENDSRCADDR 36 /* in_addr; send from specified address */
- +
- + #undef msg_control
- + #undef msg_controllen
- +
- + #undef msghdr
- + #define msghdr nmsghdr /* Redefine in IRIX 6.2 */
- +
- + /* XXX This will become msghdr in the next release */
- + struct nmsghdr {
- + caddr_t msg_name; /* optional address */
- + int msg_namelen; /* size of address */
- + struct iovec *msg_iov; /* scatter/gather array */
- + int msg_iovlen; /* # elements in msg_iov */
- + caddr_t msg_control; /* ancillary data, see below */
- + int msg_controllen; /* ancillary data buffer len */
- + int msg_flags; /* flags on received message */
- + };
- +
- + /*
- + * Header for ancillary data objects in msg_control buffer.
- + * Used for additional information with/about a datagram
- + * not expressible by flags. The format is a sequence
- + * of message elements headed by cmsghdr structures.
- + */
- + struct cmsghdr {
- + size_t cmsg_len; /* data byte count, including hdr */
- + int cmsg_level; /* originating protocol */
- + int cmsg_type; /* protocol-specific type */
- + /* followed by u_char cmsg_data[]; */
- + };
- +
- + #define _ALIGNBYTES 7
- + #define _ALIGN(p) (((u_int)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
- +
- + /* given pointer to struct cmsghdr, return pointer to data */
- + #define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
- +
- + /* given pointer to struct cmsghdr, return pointer to next cmsghdr */
- + #define CMSG_NXTHDR(mhdr, cmsg) \
- + (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- + (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- + (struct cmsghdr *)NULL : \
- + (struct cmsghdr *)((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len)))
- +
- + #define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
- +
- + #endif /* #ifndef CMSG_FIRSTHDR */
- +
- + #include "port_before.h"
- +
- + #include <arpa/nameser.h>
- + #include <stdio.h>
- + /*#include "named.h"*/
- +
- + #if defined(_TRUSTED_IRIX)
- +
- + #include <errno.h> /* oserror(), setoserror() */
- +
- + #include <sys/types.h> /* mac.h */
- + #include <sys/mac.h> /* tsix_get_mac(), tsix_set_mac(),
- + * mac_free(), tsix_set_mac_byrhost()
- + * tsix_set_solabel()
- + */
- + #include <sys/t6net.h> /* tsix_get_mac(), tsix_set_mac(),
- + * tsix_set_mac_byrhost(), tsix_set_solabel()
- + */
- +
- + #endif /* #if defined(_TRUSTED_IRIX) */
- +
- + #include "port_after.h"
- +
- + #if defined(_USE_ONE_SOCKET_PER_PROTOCOL) || defined(_TRUSTED_IRIX)
- +
- +
- + /* Send messages specifying source address and/or MAC label */
- +
- + int
- + sendfromto(int fd, void *buf, int buflen, int flags
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + , struct in_addr *from
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- + , void *to, int tolen
- + #ifdef _TRUSTED_IRIX
- + , mac_t lbl
- + #endif /* _TRUSTED_IRIX */
- + )
- + {
- +
- + struct msghdr msg;
- + struct iovec iov;
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + struct cmsghdr *cmsg;
- + char control[256];
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + iov.iov_len = buflen;
- + iov.iov_base = buf;
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + if (from && from->s_addr) {
- +
- + cmsg = (struct cmsghdr *)control;
- + cmsg->cmsg_type = IP_SENDSRCADDR;
- + cmsg->cmsg_level = IPPROTO_IP;
- + cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct in_addr);
- + bcopy(from, cmsg + 1, sizeof(struct in_addr));
- + msg.msg_controllen = cmsg->cmsg_len;
- + msg.msg_control = control;
- +
- + } else {
- +
- + msg.msg_controllen = 0;
- + msg.msg_control = (void *)0;
- +
- + }
- + #else /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + msg.msg_controllen = 0;
- + msg.msg_control = (void *)0;
- +
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + msg.msg_namelen = tolen;
- + msg.msg_name = to;
- + msg.msg_iovlen = 1;
- + msg.msg_iov = &iov;
- +
- + #ifdef _TRUSTED_IRIX
- + if (tsix_set_mac(fd, lbl) == -1) {
- +
- + return -1;
- +
- + }
- + #endif /* _TRUSTED_IRIX */
- +
- + return sendmsg(fd, &msg, flags);
- +
- + }/* int sendfromto() */
- +
- +
- +
- +
- +
- + /* Recives messages recording receiving interface and/or MAC label */
- +
- + int
- + recvfromto(int fd, void *buf, int buflen, int flags, struct sockaddr *from,
- + int fromlen
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + , struct in_addr *to
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- + #ifdef _TRUSTED_IRIX
- + , mac_t *lbl
- + #endif /* _TRUSTED_IRIX */
- + )
- + {
- +
- + int status;
- + struct msghdr msg;
- + struct iovec iov;
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + struct cmsghdr *cmsg;
- + char control[256];
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- +
- + iov.iov_len = buflen;
- + iov.iov_base = buf;
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + bzero(control, sizeof(control));
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + msg.msg_namelen = fromlen;
- + msg.msg_name = (caddr_t)from;
- + msg.msg_iovlen = 1;
- + msg.msg_iov = &iov;
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + msg.msg_controllen = sizeof(control);
- + msg.msg_control = control;
- + #else
- + msg.msg_controllen = 0;
- + msg.msg_control = (void *)0;
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- + if (to) {
- +
- + bzero(to, sizeof(struct in_addr));
- +
- + }
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + status = recvmsg(fd, &msg, flags);
- +
- + if (status > 0) {
- +
- + #ifdef _TRUSTED_IRIX
- +
- + /* Get MAC label for source of message
- + * SHOULDN'T THIS CALL BE BEFORE recvmsg()?
- + *
- + */
- +
- + status = ((tsix_get_mac(fd, lbl) == 0) ? status : -1);
- +
- + #endif /* _TRUSTED_IRIX */
- +
- + #ifdef _USE_ONE_SOCKET_PER_PROTOCOL
- +
- + /* Get the 'to' or target address for current message */
- +
- + if (to) {
- +
- + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg;
- + cmsg = CMSG_NXTHDR(&msg, cmsg)) {
- +
- + if (cmsg->cmsg_level == IPPROTO_IP &&
- + cmsg->cmsg_type == IP_RECVDSTADDR) {
- +
- + bcopy(CMSG_DATA(cmsg), to, sizeof(struct in_addr));
- +
- + }
- +
- + }/* for() */
- +
- + }/* if (to) */
- +
- + #endif /* _USE_ONE_SOCKET_PER_PROTOCOL */
- +
- + }/* if (status > 0) */
- +
- + return status;
- +
- + }/* int recvfromto() */
- +
- + #endif /*#if defined(_USE_ONE_SOCKET_PER_PROTOCOL)*/
- +
- +
- + #ifdef _TRUSTED_IRIX
- +
- + /* Set the outgoing MAC label of a socket that was created through the
- + * accept() call to the MAC label of the connecting node.
- + */
- +
- + int
- + app_tsix_set_accept_mac( int fd )
- + {
- +
- + int error; /* Preserve error code */
- + mac_t mac_lbl;
- +
- +
- + if (fd >= 0)
- + {
- +
- + /* Set MAC on fd to that of the connecting entity */
- +
- + if ( (tsix_on(fd) == -1)\
- + || (tsix_get_mac(fd, &mac_lbl) == -1))
- + {
- +
- + return -1;
- +
- + }
- + else if (tsix_set_mac(fd, mac_lbl) == -1)
- + {
- +
- + error = oserror();
- + mac_free(mac_lbl);
- + setoserror( error );
- + return -1;
- +
- + }
- + else
- + {
- +
- + mac_free(mac_lbl);
- +
- + /* This tsix_off() was used in the previous version of Bind.
- + * I have taken it out because according to the man pages it
- + * will stop trusted operation on the socket.
- + */
- +
- + /* if (tsix_off(fd) == -1) { */
- + /* return -1; */
- + /* } */
- +
- + }
- +
- + return 0;
- +
- + }
- + else
- + {
- +
- + return -1; /* Invalid file descriptor! */
- +
- + }
- +
- + }/* int app_tsix_set_accept_mac() */
- +
- +
- +
- +
- + /* Set the MAC label of a socket to be connected to a given remote address */
- +
- + int
- + app_tsix_set_connect_mac( int fd, struct sockaddr_in * ra)
- + {
- +
- + mac_t mac_lbl;
- +
- + /*
- + * Set MAC label of all outgoing comm and the socket to default
- + * remote MAC label.
- + *
- + * NOTE: IF THIS GETS CALLED MORE THAN ONCE FOR THE SAME
- + * SOCKET YOU MAY NEED TO SET MAC ONLY THE FIRST TIME THROUGH.
- + *
- + * First enable trusted operation on the socket (tsix_on()), then
- + * set MAC label of all outgoing info on the socket to the default for
- + * remote host, and finally, set MAC label of the socket itself.
- + * NOT SURE IF tsix_set_solabel() DOES THE SAME AS
- + * tsix_set_mac_byrhost(), THE MAN PAGES DO NOT HELP IN CLEARING THIS.
- + *
- + */
- +
- + if ( ((tsix_on( fd ) == -1)\
- + || (tsix_set_mac_byrhost(fd, &(ra->sin_addr), &mac_lbl) == -1)\
- + || (tsix_set_solabel(fd, mac_lbl) == -1)) )
- + {
- +
- + return -1;
- +
- + }
- +
- + return 0;
- +
- + }/*int app_tsix_set_connect_mac() */
- +
- +
- + #endif /* #ifdef _TRUSTED_IRIX */
- + /* This fucntion is used to emulate ioctl( SIOCGIFCONF ) in IRIX so that
- + * it will behave like in most UNIX systems returning an entry for each
- + * IP interface. This fixes the IP aliasing problem in IRIX.
- + * The sysctl system call is used to retrieve the interface info which is
- + * the transfered to the ifconf structure returned by ioctl().
- + *
- + * File: emul_ioctl.c
- + * By: gomez@cs.purdue.edu
- + * Date: 11/02/98
- + *
- + */
- +
- + /* Enable if you want interfaces that are down to be ignored */
- + /* #define _IGNORE_DOWN_IFACES */
- +
- + #include <stdio.h> /* NULL */
- + #include <sys/types.h>
- + #include <sys/sysctl.h> /* sysctl() */
- + #include <sys/socket.h> /* sysctl(), struct sockaddr */
- + #include <stdlib.h> /* malloc() */
- + #include <net/route.h> /* RTM_* */
- + #include <net/if_dl.h> /* struct sockaddr_dl */
- + #include <string.h> /* memcpy(), memset() */
- + #include <errno.h> /* setoserror() */
- +
- + #define ROUNDUP( sz ) (( (sz) > 0 ) ?\
- + ( 1 + (((sz) - 1) | (sizeof(__uint64_t) - 1))) :\
- + 0)
- +
- + #ifdef _HAVE_SA_LEN
- + #define ADVANCE( ptr, sa ) ptr += ROUNDUP( (sa)->sa_len )
- + #else
- + #define ADVANCE( ptr, sa ) ptr += ROUNDUP( _FAKE_SA_LEN_DST(sa) )
- + #endif
- +
- + int
- + emul_ioctl( struct ifconf * ifc )
- + {
- + size_t bufsz, used_sz;
- + char *buf, *ptr, *end_ptr;
- + int mib[6] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
- + struct if_msghdr *ifmsghdr; /* Iface info */
- + struct ifa_msghdr *ifamsghdr; /* Iface address info */
- + char if_name[IFNAMSIZ]; /* Interface name */
- + struct sockaddr_dl *if_addr; /* Interface name struct */
- + char *addr_ptr; /* Next address */
- + struct ifreq *ifreq_ptr; /* current ifreq */
- + struct sockaddr *curr_addr;
- +
- + /* Check parameter */
- +
- + if ( (ifc == NULL) || (ifc->ifc_len <= 0) || (ifc->ifc_buf == NULL) )
- + {
- +
- + setoserror(EINVAL);
- + return -1;
- +
- + }
- +
- + /* Get size of buffer needed */
- +
- + if (sysctl(mib, 6, NULL, &bufsz, NULL, 0) < 0)
- + {
- +
- + return -1;
- +
- + }
- +
- +
- + /* Allocate memmory and retrieve info */
- +
- + if ((buf = malloc(bufsz)) == NULL)
- + {
- +
- + return -1;
- +
- + }
- +
- + if (sysctl(mib, 6, buf, &bufsz, NULL, 0) < 0)
- + {
- +
- + return -1;
- +
- + }
- +
- + /* Place info in ifconf structure */
- +
- + for ( ptr = buf, end_ptr = buf + bufsz, if_name[0] = '\0', used_sz = 0,\
- + ifreq_ptr = (struct ifreq *)(ifc->ifc_buf);\
- + ptr < end_ptr;\
- + ptr += ifmsghdr->ifm_msglen )
- + {
- +
- + ifmsghdr = (struct if_msghdr *)ptr;
- +
- + if ( ifmsghdr->ifm_type == RTM_IFINFO )
- + {
- +
- + memset( if_name, 0, IFNAMSIZ );
- +
- + /* We only get interface name from this message */
- +
- + if ( ifmsghdr->ifm_addrs & RTA_IFP )
- + {
- +
- + #ifdef _IGNORE_DOWN_IFACES
- + if (!(IFF_UP & ifcmsghdr->ifm_flags))
- + {
- +
- + /* Skip if iface is down */
- + continue;
- +
- + }
- + #endif
- +
- + if_addr = (struct sockaddr_dl *)(ifmsghdr + 1);
- + memcpy( if_name, if_addr->sdl_data,\
- + MIN( (size_t)(if_addr->sdl_nlen), IFNAMSIZ ) );
- +
- + }/* if ( ifmsghdr->ifm_addrs & RTA_IFP ) */
- +
- + }
- + else if ( ifmsghdr->ifm_type == RTM_NEWADDR )
- + {
- +
- + if ( if_name[0] == '\0' )
- + {
- +
- + /* No iface name for this address ignore */
- + continue;
- +
- + }
- +
- + /* Here we get the address info and create an entry in ifc */
- +
- + ifamsghdr = (struct ifa_msghdr *)ptr; /* Correct format */
- + addr_ptr = (char *)(ifamsghdr + 1);
- + curr_addr= (struct sockaddr *)addr_ptr;
- +
- + if ( ifamsghdr->ifam_addrs & RTA_NETMASK )
- + {
- +
- + /* Mask address present, skip it */
- +
- + ADVANCE( addr_ptr, curr_addr );
- + curr_addr = (struct sockaddr *)addr_ptr;
- +
- + }/* if ( ifamsghdr->ifam_addrs & RTA_NETMASK ) */
- +
- +
- + if ( ifamsghdr->ifam_addrs & RTA_IFA )
- + {
- +
- + /* Get interface address and create ifc entry */
- +
- + used_sz += sizeof(struct ifreq);
- +
- + if ( used_sz > ifc->ifc_len )
- + {
- +
- + /* Return whatever we were able to retrieve with given
- + * buffer.
- + */
- +
- + ifc->ifc_len = used_sz - sizeof(struct ifreq);
- + setoserror( ENOMEM );
- + return -1;
- +
- + }
- +
- + memcpy( ifreq_ptr->ifr_name, if_name, IFNAMSIZ );
- +
- + #ifdef _HAVE_SA_LEN
- + memcpy( &(ifreq_ptr->ifr_addr), curr_addr, curr_addr->sa_len );
- + #else
- + memcpy( &(ifreq_ptr->ifr_addr), curr_addr,\
- + _FAKE_SA_LEN_DST(curr_addr));
- + #endif
- + ifreq_ptr++;
- +
- + }
- +
- + }
- +
- + /* The RTM_DELADDR message is ignored */
- +
- + }/* for ( ptr = buf, end_ptr = buf + bufsz, if_name[0] = '\0',...) */
- +
- + ifc->ifc_len = used_sz;
- +
- + return 0;
- +
- + }/* int emul_ioctl() */
-